<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>iicps: xiicps_repeated_start_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">iicps
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xiicps__repeated__start__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xiicps_repeated_start_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file consists of a repeated start example using xiicps driver in polled mode. </p>
<p>The slave used is an EEPROM.</p>
<p>The example is tested with a 2Kb/8Kb serial IIC EEPROM (ST M24C02/M24C08). The WP pin of this EEPROM is hardwired to ground in the HW in which this was tested. This example can be used directly to read upto 16 pages from start address in this EEPROM (Since single address byte).</p>
<p>The AddressType should be u8 as the address pointer in the on-board EEPROM is 1 bytes.</p>
<p>This code assumes that no Operating System is being used.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>The I2C controller does not indicate completion of a receive transfer if HOLD bit is set. Due to this errata, repeated start cannot be used if a receive transfer is followed by any other transfer on Zynq platform.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
<hr/>

2.1   hk   03/15/10 First release</pre><pre></pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a03067e867debb67e8cc850dad9b4491b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xiicps__repeated__start__example_8c.html#a03067e867debb67e8cc850dad9b4491b">IicPsRepeatedStartExample</a> (void)</td></tr>
<tr class="memdesc:a03067e867debb67e8cc850dad9b4491b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function writes, reads, and verifies the data to the IIC EEPROM.  <a href="#a03067e867debb67e8cc850dad9b4491b">More...</a><br /></td></tr>
<tr class="separator:a03067e867debb67e8cc850dad9b4491b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40d92867ead2dc8efe06207b8b0f3494"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xiicps__repeated__start__example_8c.html#a40d92867ead2dc8efe06207b8b0f3494">EepromWriteData</a> (u16 ByteCount)</td></tr>
<tr class="memdesc:a40d92867ead2dc8efe06207b8b0f3494"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function writes a buffer of data to the IIC serial EEPROM.  <a href="#a40d92867ead2dc8efe06207b8b0f3494">More...</a><br /></td></tr>
<tr class="separator:a40d92867ead2dc8efe06207b8b0f3494"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb01e2a9be230281dc95655303e9e68f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xiicps__repeated__start__example_8c.html#abb01e2a9be230281dc95655303e9e68f">MuxInit</a> (void)</td></tr>
<tr class="memdesc:abb01e2a9be230281dc95655303e9e68f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes the IIC MUX to select EEPROM.  <a href="#abb01e2a9be230281dc95655303e9e68f">More...</a><br /></td></tr>
<tr class="separator:abb01e2a9be230281dc95655303e9e68f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f790bd9169574f1a1a9739b827cd04f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xiicps__repeated__start__example_8c.html#a2f790bd9169574f1a1a9739b827cd04f">EepromReadDataRepStart</a> (u8 *BufferPtr, u16 ByteCount)</td></tr>
<tr class="memdesc:a2f790bd9169574f1a1a9739b827cd04f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads data from the IIC serial EEPROM into a specified buffer.  <a href="#a2f790bd9169574f1a1a9739b827cd04f">More...</a><br /></td></tr>
<tr class="separator:a2f790bd9169574f1a1a9739b827cd04f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xiicps__repeated__start__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function to call the Iic repeated start example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br /></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a2f790bd9169574f1a1a9739b827cd04f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f790bd9169574f1a1a9739b827cd04f">&#9670;&nbsp;</a></span>EepromReadDataRepStart()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int EepromReadDataRepStart </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>BufferPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>ByteCount</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads data from the IIC serial EEPROM into a specified buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BufferPtr</td><td>contains the address of the data buffer to be filled. </td></tr>
    <tr><td class="paramname">ByteCount</td><td>contains the number of bytes in the buffer to be read.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful else XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a40d92867ead2dc8efe06207b8b0f3494"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40d92867ead2dc8efe06207b8b0f3494">&#9670;&nbsp;</a></span>EepromWriteData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int EepromWriteData </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>ByteCount</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function writes a buffer of data to the IIC serial EEPROM. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ByteCount</td><td>contains the number of bytes in the buffer to be written.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful else XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The Byte count should not exceed the page size of the EEPROM as noted by the constant PAGE_SIZE. </dd></dl>

<p class="reference">References <a class="el" href="group__iicps__v3__0.html#ga71584f1a7e675cde41cfd9d1bd4320b4">XIicPs_MasterSendPolled()</a>.</p>

</div>
</div>
<a id="a03067e867debb67e8cc850dad9b4491b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03067e867debb67e8cc850dad9b4491b">&#9670;&nbsp;</a></span>IicPsRepeatedStartExample()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int IicPsRepeatedStartExample </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function writes, reads, and verifies the data to the IIC EEPROM. </p>
<p>Page write is used. Buffered read with repeated start option is done.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful else XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xiicps__repeated__start__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function to call the Iic repeated start example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful else XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xiicps__repeated__start__example_8c.html#a03067e867debb67e8cc850dad9b4491b">IicPsRepeatedStartExample()</a>.</p>

</div>
</div>
<a id="abb01e2a9be230281dc95655303e9e68f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb01e2a9be230281dc95655303e9e68f">&#9670;&nbsp;</a></span>MuxInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MuxInit </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes the IIC MUX to select EEPROM. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if pass, otherwise XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
